﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
			<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/login.css"/>
		<!--<script src="js/jquery-1.1.min.js" type="text/javascript" charset="utf-8"></script>-->
		
	</head>
	<body >
		<div class="login-body">
			<div class="login-title">
				<img src="img/GE-logo@2x.png" />
				<div class="font">
					<span >
					Imagination At Work 
				</span>
				<p >梦想成就未来</p>
				</div>
				<h3 >Login</h3>
				
			</div>
			<div class="login-body-body">
				<h2>Wecome to </h2><h2>GE Single Sign on !</h2>
				
			</div>
			<div class="login-body-body-left">
				<div class="img-box">
					<img src="img/research@2x.png"/>
				</div>
				
				<div class="controls">
				<a href="">扫一扫<input type="file" accept="image/*" capture="camera" class="camera"></a>
				</div>
				</div>
				<div class="login-body-body-right">
					<div class="from-user form">
						<img src="img/login-pic@2x.png" style="width: 1em;"/>
						<input type="text" name="userName" id="userName" value=""  placeholder="SSO ID"/>
					</div>
					<div class="from-password form">
						<img src="img/login-pw@2x.png" style="width: .9em;"/>
						<input type="password" name="password" id="password" value="" placeholder="Password" onkeyup="login()" />
					</div>
					<!--<a href="###" onclick="login()">登录</a>-->
				</div>
		</div>
	</body>
	<script src="js/URL.js" type="text/javascript" charset="utf-8"></script>
	<script src="quagga/jquery-1.9.0.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="quagga/quagga.js" type="text/javascript" charset="utf-8"></script>
	<script src="quagga/file_input.js" type="text/javascript" charset="utf-8"></script>
	
	<script type="text/javascript">
		var adr = "http://localhost:8080";
		function login (){
			var name = document.getElementById("userName").value;
			var pw = document.getElementById("password").value;
			if(pw.length == 2){
			$.ajax({
				type:"post",
				url:adr+"/login/pass",
				async:true,
				data:{
					userId:name,
					pass:pw
				},
				success:function(data){
					if(data.status == 200){
						alert('ok');
						console.log(data);
                        window.location.href = adr + "/login/setck?token="+data.data;
					}
					else{
						alert("登陆失败");
						document.getElementById("password").value='';
//                      pw = '';
					}

				}
				
			});
			}
			else{
				
			}
		}
	</script>
</html>
